package com.ca.project.core.Util;

/**
 * @PACKAGE_NAME: Utils
 * @NAME: PasswordUtil
 * @USER: ASUS
 * @DATE: 2023/7/19
 * @TIME: 上午 11:21
 **/
public class PasswordUtil {

    /**
     * 随机生成盐值
     *
     * @return
     */
    public static String getSalt() {
        return MessageDigestUtil.md5(UUIDUtil.getUUID());
    }

    /**
     * 密码加密
     *
     * @param salt
     * @param inputPassword
     * @return
     */
    public static String encryptPassword(String salt, String inputPassword) {
        return MessageDigestUtil.sha256(MessageDigestUtil.sha1(inputPassword) + salt);
    }

}
